package com.qf.fmw.entity;

import java.util.Arrays;

public class User {
    private int id;
    private String username;
    private String password;
    private String sex;
    private String[] hobbies;
    private String nativePlace;
    private String hobbiesStr;
    private String imgUrl;

    private static int addId = 1;

/*    {
        id = addId++;
    }*/

    public User() {
        id = addId++;
    }


    public User(String username, String password, String sex, String[] hobbies, String nativePlace) {
        this();
        this.username = username;
        this.password = password;
        this.sex = sex;
        this.hobbies = hobbies;
        this.nativePlace = nativePlace;
        this.hobbiesStr = Arrays.toString(hobbies);
    }

    public User(int id, String username, String sex, String hobbiesStr, String nativePlace) {
        this.username = username;
        this.id = id;
        this.sex = sex;
        this.hobbiesStr = hobbiesStr;
        this.nativePlace = nativePlace;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getHobbiesStr() {
        return hobbiesStr;
    }

    public void setHobbiesStr(String hobbiesStr) {
        this.hobbiesStr = hobbiesStr;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String[] getHobbies() {
        return hobbies;
    }

    public void setHobbies(String[] hobbies) {
        this.hobbies = hobbies;
    }

    public String getNativePlace() {
        return nativePlace;
    }

    public void setNativePlace(String nativePlace) {
        this.nativePlace = nativePlace;
    }

    public static int getAddId() {
        return addId;
    }

    public static void setAddId(int addId) {
        User.addId = addId;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", sex='" + sex + '\'' +
                ", hobbies=" + Arrays.toString(hobbies) +
                ", nativePlace='" + nativePlace + '\'' +
                '}';
    }
}
